Dependency Inversion Principle
DIP states that high-level policy should not depend directly on low-level implementation details; both should depend on abstractions. It also states that abstractions should not depend on details—the details should depend on abstractions. Dependency Injection is a technique for supplying those dependencies from outside the consumer. Therefore, DIP is a design principle, while DI is one practical mechanism for implementing it.
DIP is a design principle.
Dependency Injection is a technique for supplying dependencies.
High-level business logic should not construct infrastructure dependencies directly.
Constructor injection makes dependencies explicit.
DIP improves substitution, testing and architectural boundaries.